package me.trytofeel.service.impl;

import lombok.Data;
import me.trytofeel.bean.Video;
import me.trytofeel.mapper.VideoMapper;
import me.trytofeel.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Data
@Service
public class VideoServiceImpl implements VideoService {
    @Autowired
    private VideoMapper videoMapper;

    @Override
    public boolean insertVideo(Video video) {
        return videoMapper.insertVideo(video) > 0;
    }

    @Override
    public boolean deleteVideoById(int id) {
        return videoMapper.deleteVideoById(id) > 0;
    }

    @Override
    public boolean updateVideo(Video video) {
        return videoMapper.updateVideo(video) > 0;
    }

    @Override
    public List<Video> selectAllVideos() {
        return videoMapper.selectAllVideos();
    }

    @Override
    public Video selectVideoById(int id) {
        return videoMapper.selectVideoById(id);
    }
}
